package com.icngor.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.opensymphony.xwork2.interceptor.annotations.Allowed;

/**
 * TMenu entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "t_menu", catalog = "sy")
public class TMenu implements java.io.Serializable {

	// Fields

	private String id;
	private TMenu TMenu;
	private String textx;
	private String iconCls;
	private String url;
	private Set<TMenu> TMenus = new HashSet<TMenu>(0);

	// Constructors

	/** default constructor */
	public TMenu() {
	}

	/** minimal constructor */
	public TMenu(String textx, String iconCls, String url) {
		this.textx = textx;
		this.iconCls = iconCls;
		this.url = url;
	}

	/** full constructor */
	public TMenu(TMenu TMenu, String textx, String iconCls, String url, Set<TMenu> TMenus) {
		this.TMenu = TMenu;
		this.textx = textx;
		this.iconCls = iconCls;
		this.url = url;
		this.TMenus = TMenus;
	}

	// Property accessors
	@Id
	@Column(name = "id", unique = true, nullable = false, length = 36)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "pid")
	public TMenu getTMenu() {
		return this.TMenu;
	}

	public void setTMenu(TMenu TMenu) {
		this.TMenu = TMenu;
	}

	@Column(name = "textx", nullable = false, length = 100)
	public String getTextx() {
		return this.textx;
	}

	public void setTextx(String textx) {
		this.textx = textx;
	}

	@Column(name = "iconcls", nullable = false, length = 50)
	public String getIconCls() {
		return this.iconCls;
	}

	public void setIconCls(String iconCls) {
		this.iconCls = iconCls;
	}

	@Column(name = "url", nullable = false, length = 200)
	public String getUrl() {
		return this.url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "TMenu")
	public Set<TMenu> getTMenus() {
		return this.TMenus;
	}

	public void setTMenus(Set<TMenu> TMenus) {
		this.TMenus = TMenus;
	}

}